import axios from '@/utils/axios'

export const getPoem = (id: string): Promise<ApiResult<LiteraturePoemPO>> => {
  return axios.get(`literature/poem/${id}`)
}

export const getPoemPage = (
  pagination: Pagination,
  params: LiteraturePoemPO
): Promise<ApiResult<Page<LiteraturePoemPO>>> => {
  return axios.get(`literature/poem/page/${pagination.page}/${pagination.pageSize}`, {
    params
  })
}

export const postOrPutPoem = (data: LiteraturePoemPO): Promise<ApiResult<null>> => {
  return axios.post(`literature/poem`, data)
}

export const deletePoem = (id: string): Promise<ApiResult<null>> => {
  return axios.delete(`literature/poem/${id}`)
}
